<span class="action-link">
    <a id="js-edit-btn-post-body-{{ answer.pk }}" class="question-edit js-edit" href="{% url edit_answer answer.id %}">{% trans %}edit{% endtrans %}</a>
</span>
{% if answer.offensive_flag_count > 0 %}
<span 
    id="answer-offensive-remove-flag-{{ answer.id }}"
    class="action-link offensive-flag"
    title="{% trans %}remove offensive flag{% endtrans %}"
>
    <a class="question-flag">{% trans %}remove flag{% endtrans %}</a>
</span>
<span 
    id="answer-offensive-flag-{{ answer.id }}"
    class="action-link offensive-flag"
    title="{% trans %}report as offensive (i.e containing spam, advertising, malicious text, etc.){% endtrans %}"
>
    <a class="question-flag">{% trans %}flag offensive{% endtrans %} ({{ answer.offensive_flag_count }})</a>
</span>
{% else %}
<span 
    id="answer-offensive-flag-{{ answer.id }}"
    class="action-link offensive-flag"
    title="{% trans %}report as offensive (i.e containing spam, advertising, malicious text, etc.){% endtrans %}"
>
    <a class="question-flag">{% trans %}flag offensive{% endtrans %}</a>
</span>
{% endif %}
<span id='post-{{answer.id}}-delete' class="action-link delete-post">
    <a class="question-delete"
    >{% if answer.deleted %}{% trans %}undelete{% endtrans %}{% else %}{% trans %}delete{% endtrans %}{% endif %}</a>
</span>
{% if thread.is_moderated() %}
<span 
    id="post-{{answer.id}}-publish"
    class="action-link"
>
    {% if answer.id in published_answer_ids %}
        <a 
            class="answer-unpublish"
            data-answer-id="{{ answer.id }}"
        >{% trans %}unpublish{% endtrans %}</a>
    {% else %}
        <a 
            class="answer-publish"
            data-answer-id="{{ answer.id}}"
        >{% trans %}publish{% endtrans %}</a>
    {% endif %}
</span>
{% endif %}
<span class="action-link">
    <a  class="permant-link"
        href="{{ answer.get_absolute_url(question_post=question) }}"
        title="{% trans %}permanent link{% endtrans %}">
        {% trans %}link{% endtrans %}
    </a>
</span>
<span class="action-link dropdown-toggle">{% trans %}more{% endtrans %}
<ul class="dropdown-menu">
    <li id='post-{{answer.id}}-convert'>
        <form 
            class="answer-convert"
            action="{% url repost_answer_as_comment_under_question %}"
            method="post"
        >
            {% csrf_token %}
            <input type="hidden" name="answer_id" value="{{answer.id}}"/>
            <input 
                type="submit"
                class="link"
                value="{{ settings.WORDS_REPOST_AS_A_QUESTION_COMMENT|escape }}"
            />
        </form>
    </li>
    <li id='post-{{ answer.id }}-repost-as-comment-under-previous-answer'>
        <form class="answer-convert repost-as-comment-under-previous-answer"
            action="{% url repost_answer_as_comment_under_previous_answer %}"
            method="post"
        >
            {% csrf_token %}
            <input type="hidden" name="answer_id" value="{{ answer.id }}"/>
            <input 
                type="submit"
                class="link"
                value="{{ settings.WORDS_REPOST_AS_A_COMMENT_UNDER_THE_OLDER_ANSWER|escape }}"
            />
        </form>
    </li>
</ul>
</span>
<script type="text/javascript">
    askbot['functions']['hideConvertAnswerLinks']('{{ answer.id }}');
    askbot['functions']['hidePublishAnswerLink']('{{ answer.id }}');
    askbot['functions']['renderPostControls']('{{ answer.id }}'{{ ', true' if answer.wiki }});
</script>
